//var form = Ext.create('Ext.form.Panel', {
//    store: ['sale.xsckdStore'],
//	layout: 'column',
//	baseCls: 'x-plain',
//	items:[
//			{
//				 
//				 xtype: 'testText1',
//				 name: 'bizMan',
//				 fieldLabel: '业务人员',
//				 
//				 
//			},
//			{
//				 xtype: 'testText1',
//				 name: 'maker',
//				 fieldLabel: '制单人员',
//			},
//			{
//				 xtype: 'testText1',
//				 name: '',
//				 fieldLabel: '所属部门',
//			},
//			{
//				 xtype: 'testText1',
//				 name: 'permitter',
//				 fieldLabel: '复核人员',
//			},
//			{
//				 xtype: 'testText1',
//				 name: '',
//				 fieldLabel: '所属项目',
//			},
//			{
//				 xtype: 'testText1',
//				 name: '',
//				 fieldLabel: '客户',
//			}
//	      ]
//});

//var grids = Ext.create('Ext.grid.Panel',{
//	store: ['sale.xsckdStore'],
//	height: 160,
//	stripeRows:true,   
//	autoScroll:false,
//	columns: [
//				{xtype: 'rownumberer', header: '（栏号）', name: 'lineId', dataIndex: 'lineId', width: 50,sortable: false },
//        		{header: '物料编号', dataIndex: '', width: 100 ,editor:"textfield"},
//       			{header: '物料名称', dataIndex: '', width: 120,editor:"textfield" },
//       			{header: '规格型号', dataIndex: '' ,editor:"textfield"},
//				{header: '单位名称', dataIndex: '' ,editor:"textfield"},
//				{header: '数量', dataIndex: 'quantity',editor:"textfield"},
//				{header: '折扣前单价', dataIndex: 'oldPrice',editor:"textfield" },
//				{header: '折数(%)', dataIndex: 'discount' ,editor:"textfield"},
//				{header: '单价', dataIndex: 'unitPrice' ,editor:"textfield"},
//				{header: '金额', dataIndex: 'amount' ,editor:"textfield"},
//				{header: '税率', dataIndex: 'taxRate',editor:"textfield" },
//				{header: '税额', dataIndex: 'tax' ,editor:"textfield"},
//				{header: '含税金额', dataIndex: 'taxAmount',editor:"textfield" },
//				{header: '批号', dataIndex: '',editor:"textfield" },
//				{header: '物理组合', dataIndex: '',editor:"textfield" },
//				{header: '赠品', dataIndex: 'isGift',editor:"textfield" },
//				{header: '分录备注', dataIndex: 'itemRemark',editor:"textfield" },
//				{header: '来源单别', dataIndex: 'sourceType' ,editor:"textfield"},
//				{header: '来源单号', dataIndex: 'sourceOrder' ,editor:"textfield"},
//				{header: '客户订单', dataIndex: '',editor:"textfield" }
//			 ],
//	plugins: [  
//			   Ext.create('Ext.grid.plugin.CellEditing',{  
//				   clicksToEdit:1 //设置单击单元格编辑  
//			   })  
//			 ],  
//	listeners:{
//			    //双击行事件  
//		itemdblclick:function(dataview, record, item, index, e){
//			alert('itemdblclick');
//			var data  = {  
//			};
//			//添加一行表格
//			this.getStore().add(data);
//		}
//	}
//		 
//});
//var filterPanel = Ext.create('Ext.panel.Panel', {
//    width: 2000,
//    items:[grids],
//	bbar:[{xtype:"label",text:'总计:',width:90},
//	{xtype:"textfield",disabled:true,width:90,margin:'0 180',value:'0.00'},
//	{xtype:"textfield",disabled:true,width:90,margin:'0',value:'0.00'},
//	{xtype:"textfield",disabled:true,width:90,margin:'0 40 0 30',value:'0.00'},
//	{xtype:"textfield",disabled:true,width:90,margin:'0 0 0 0',value:'0.00'}]
//});

//var  tableds = Ext.create('Ext.TabPanel',{
//	width: 950,
//	height: 230,
//	autoScroll:true,
//	style: 'margin:10px 0px 0px 60px',
//	items: [{title:'内容',autoScroll:true,items:[filterPanel]},{title:'账款'},{title:'备注'}],
//});

//var fielmenu = new Ext.menu.Menu({
//	items:[
//	       {
//	    	   text:'历史交易查询',handler:function(){
//	    	   afronction();
//		
//	    	   }
//	       }
//	      ]
//});
//var fielmenu2 = new Ext.menu.Menu({
//	items:[{text:'销售报价转入'},{text:'销售订单转入'}]
//});
//var fielmenu3 = new Ext.menu.Menu({
//	items:[{text:'物料组合设定'},{text:'批次变更单价'}]
//});
	
Ext.define('Demo.view.sale.xsckdPanel',{
	extend: 'Ext.panel.Panel',
	alias: 'widget.xsckdPanel',
	items: [
	        {
	        	xtype: 'topBar',
	        	id: "xsckdTop",
	        	store: Ext.create("Demo.store.sale.xsckdStore",{})
	        },
	        {
	        	xtype:"form",
	        	layout:'column',
	        	url: '/saleOutStorage/add',
	        	items:[
	        	       {
		        	    	 xtype: 'testText1',
					    	 name: 'custNo',
							 fieldLabel: '客户',
	        	       },
					   {		
							 style: 'margin:10px 0px 0px 60px;',
					    	 xtype: 'datefield',
							 name: 'billDate',
							 bodyPadding: 5,
							 fieldLabel: '单据日期',
							 width: 250,
							 labelWidth: 80,
							 format:'Y-m-d', 
							 value: new Date()
					   },
					   {
					    	 xtype: 'testText1',
							 name: 'addressId',
							 fieldLabel: '送货地址',
							 width: 180,
					   },
					   {	
						   	 style: 'margin-top:10px',
						   	 xtype: 'testText1',
							 name: '',
							 width: 150,
					   },
					   {
						   	 xtype: 'testText1',
							 name: 'billNo',
							 fieldLabel: '单据号码',
							 width: 250,
					   },
					   {
						   	 xtype: 'testText1',
							 name: '',
							 fieldLabel: '销售出库类型',
							 width: 250,
					   },
					   {
						     xtype: 'testText1',
							 name: 'moneyType',
							 fieldLabel: '币别',
							 width: 250,
							 value: '人民币'
					   },
					   {
						     style: 'margin:10px 0px 0px 60px;',
						     xtype: 'combo',
					    	 name: 'isTax',
							 bodyPadding: 5,
							 fieldLabel: '单价是否含税',
							 width: 250,
							 labelWidth: 80,
							 valueField : 'isTax',  
							 displayField : 'text',
							 value: '1',
							 store: Ext.create('Ext.data.Store', {
									fields: ['isTax', 'text'],
			    					data : [
			    					        {"isTax":"1", "text":"未税"},
			    					        {"isTax":"2", "text":"含税"}
			    					       ]
								}),
					   },
					   {
						     xtype: 'testText1',
							 name: 'exchRate',
							 fieldLabel: '汇率',
							 width: 250,
							 value: '1.0000'
					   },
					   {
						     xtype: 'testText1',
							 name: 'wareNo',
							 fieldLabel: '仓库',
					   },
					   {
						     xtype: 'testText1',
							 name: '',
							 fieldLabel: '国外贸易',
							 value: '否'
					   },
					   {
						   	 xtype: 'testText1',
							 name: '',
							 fieldLabel: '凭证编号',
					   },
					   {
						     style: 'margin:10px 0px 0px 62px;',
						     xtype: 'checkbox',
							 name: '',
							 bodyPadding: 5,
							 hideLabels:true,
							 checkboxToggle:true,
							 boxLabel:"复核后自动生成发票",
					         items:[{boxLabel:"复核后自动生成发票",inputValue:1,checked:true}]
					   },
					   {
						   xtype: 'testText1',
						   name: 'createTime',
						   hidden: true
					   },
					   {
							xtype: 'tabpanel',
						    width: 950,
							height: 230,
							style: 'margin:10px 0px 0px 60px',
							items: [
							        {
							        	title:'内容',
							        	autoScroll:true,
							        	items:[
											   { 
												   xtype: 'panel',
												   
												   items:[
												          {
												        	  xtype: 'grid',
												        	  store: ['sale.xsckdStore'],
												        	  height: 160,
												        	  columns: [
												        	            {header: '（栏号）', dataIndex: 'lineId', width: 50, editor:"textfield"},
												        		        {header: '物料编号', dataIndex: 'materialNo', width: 100 ,editor:"textfield"},
												        		       	{header: '(物料名称)', dataIndex: 'aa', width: 120, },
												        		       	{header: '(规格型号)', dataIndex: 'aaa' ,},
												        				{header: '(单位名称)', dataIndex: 'aaaa' ,},
												        				{header: '数量', dataIndex: 'quantity',editor:"textfield"},
												        				{header: '折扣前单价', dataIndex: 'oldPrice',editor:"textfield" },
												        				{header: '折数(%)', dataIndex: 'discount' ,editor:"textfield"},
												        				{header: '单价', dataIndex: 'unitPrice' ,editor:"textfield"},
												        				{header: '(金额)', dataIndex: 'amount' ,editor:"textfield"},
												        				{header: '税率', dataIndex: 'taxRate',editor:"textfield" },
												        				{header: '(税额)', dataIndex: 'tax' ,editor:"textfield"},
												        				{header: '含税金额', dataIndex: 'taxAmount',editor:"textfield" },
												        				{header: '赠品', dataIndex: 'isGift',editor:"textfield" },
												        				{header: '分录备注', dataIndex: 'itemRemark',editor:"textfield" },
												        				{header: '(来源单别)', dataIndex: 'sourceType' ,},
												        				{header: '(来源单号)', dataIndex: 'sourceOrder' ,},
												        				{header: '客户订单', dataIndex: 'aaaaa',editor:"textfield" }
												        			   ],
												        	  plugins: [  
												        	            Ext.create('Ext.grid.plugin.CellEditing',{  
												        					clicksToEdit:1 //设置单击单元格编辑  
												        				})  
												        			   ],  
												        	  listeners:{
												        				 //双击行事件  
												        		  itemdblclick:function(dataview, record, item, index, e){
												        			  alert('itemdblclick');
												        			  var data  = {  
												        			  };
												        			  //添加一行表格
												        			  this.getStore().add(data);
												        		}
												        	  }
												          	}
												          ],
												          width: 2000,
												          bbar:[
														         {xtype:"label",text:'总计:',width:90},
														         {xtype:"textfield",disabled:true,width:90,margin:'0 180',value:'0.00'},
														         {xtype:"textfield",disabled:true,width:90,margin:'0',value:'0.00'},
														         {xtype:"textfield",disabled:true,width:90,margin:'0 40 0 30',value:'0.00'},
														         {xtype:"textfield",disabled:true,width:90,margin:'0 0 0 0',value:'0.00'}
														        ],
												        
											    }
							        	      ]
							        },
							        {title:'账款'},
							        {title:'备注'}
							       ],
					   }
					   ,{
						   xtyle: 'form',
						   store: ['sale.xsckdStore'],
						   layout: 'column',
						   baseCls: 'x-plain',
						   items:[
						          {
									xtype: 'testText1',
									name: 'bizMan',
									fieldLabel: '业务人员',
						          },
								  {
									xtype: 'testText1',
									name: 'maker',
									fieldLabel: '制单人员',
									value: 'admin'
								  },
								  {
									 xtype: 'testText1',
									 name: '',
									 fieldLabel: '所属部门',
								  },
								  {
									 xtype: 'testText1',
									 name: 'permitter',
									 fieldLabel: '复核人员',
								  },
								  {
									 xtype: 'testText1',
									 name: '',
									 fieldLabel: '所属项目',
								  }
						         ]
					   	},{
					   		style: 'margin:10px 0px 0px 60px',
					   		xtype: 'splitbutton',
					   		text: '查询',
					   		width: 90,
					   		menu: {
				   		 	       xtype: 'menu',
				   		 	       items: [
					   		 	       {
					   			    	   text:'历史交易查询',handler:function(){
					   			    	   afronction();
					   				
					   			    	   }
					   			       }
					   		 	   ] 
					   			  }
					   	},
					   	{
					   		style: 'margin:10px 0px 0px 20px',
					   		xtype:"splitbutton",
					   		text:'转单',
					   		width:90,
					   		menu:{
				   		 	       xtype: 'menu',
				   		 	       items: [
					   		 	       {
					   			    	   text:'销售报价转入',handler:function(){
					   			    	   afronction();
					   				
					   			    	   }
					   			       }
					   		 	   ] 
					   			  }
					   	},
					   	{
					   		style: 'margin:10px 0px 0px 20px',
					   		xtype:"splitbutton",
					   		text:'功能',
					   		width:90,
					   		menu:{
				   		 	       xtype: 'menu',
				   		 	       items: [
					   		 	       {
					   			    	   text:'物料组合设定',handler:function(){
					   			    	   afronction();
					   				
					   			    	   }
					   			       }
					   		 	   ] 
					   			  }
					   	}
					   ]
	        }
	      ]
});